package com.project.webapp.action.backend;

import com.project.common.util.QueryUtils;
import com.project.dao.bean.Customer;
import com.project.service.backend.CustomerService;
import com.project.webapp.action.BaseAction;

/**
 * @author liming
 * 时间：2012年11月14日 11:18:26
 * 说明：本类是用户注册信息的管理操作
 */
public class CustomerAction extends BaseAction{
	private QueryUtils queryUtils;
	private Customer customer;
	private CustomerService customerService;
	//分页显示用户信息
	public String customerlist(){
		queryUtils=customerService.customerlist(queryUtils);
		queryUtils.setLocation(new StringBuffer("customer!customerlist.action"));
		return SUCCESS;
	}
	//用户删除方法
	public String delete(){
		System.out.println("欢迎进入delete方法方法");
		System.out.println("删除方法出入的id"+customer.getId());
		customerService.delete(customer.getId());
		return "delete";
	}
	//根据id返回一条信息
	public String findbyid(){
		System.out.println("欢迎进入findybyid方法");
		//System.out.println("传入的id"+customer.getId());
		customer=customerService.findbyid(customer.getId());
		//System.out.println("取回的id："+customer.getId());
		return "findbyid";
	}
	//更新一条记录的方法
	public String update(){
		System.out.println("欢迎进入update方法。。");
		customerService.update(customer);
		return "update";
	}
	public QueryUtils getQueryUtils() {
		return queryUtils;
	}

	public void setQueryUtils(QueryUtils queryUtils) {
		this.queryUtils = queryUtils;
	}

	public CustomerService getCustomerService() {
		return customerService;
	}

	public void setCustomerService(CustomerService customerService) {
		this.customerService = customerService;
	}
	public Customer getCustomer() {
		return customer;
	}
	public void setCustomer(Customer customer) {
		this.customer = customer;
	}
	
	
}
